﻿using System;
using System.Web;
using System.Data;
using System.Linq;
using System.Web.Services;
using System.Collections.Generic;

namespace WS
{
    using BLL;
    using DAL;
    using DAL.Entities;

    /// <summary>
    /// Summary description for Catalog
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class Catalog : System.Web.Services.WebService
    {

        #region Danh muc
        DanhmucBLL _bllDanhmuc = new DanhmucBLL();

        [WebMethod]
        public int CountDanhmuc()
        {
            throw new NotImplementedException();
        }

        [WebMethod]
        public DataTable SelectDanhmuc()
        {
            return _bllDanhmuc.Select();
        }

        [WebMethod]
        public object InsertDanhmuc(Danhmuc obj)
        {
            return _bllDanhmuc.Insert(obj);
        }

        [WebMethod]
        public object UpdateDanhmuc(Danhmuc obj)
        {
            return _bllDanhmuc.Update(obj);
        }

        [WebMethod]
        public object DeleteDanhmuc(Guid id)
        {
            return _bllDanhmuc.Delete(id);
        }

        [WebMethod]
        public DataTable SelectLoai(string loai)
        {
            return _bllDanhmuc.SelectLoai(loai);
        }
        #endregion

        [WebMethod]
        public DataTable SelectLoai_Child(Guid Id_Parent)
        {
            return _bllDanhmuc.SelectLoai_Child(Id_Parent);
        }
    }
}